package com.tmy.controller;

import com.tmy.Dto.PageInfo;
import com.tmy.Dto.Result;
import com.tmy.entity.UserInfo;
import com.tmy.service.UserInfoService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/userInfo")
public class UserInfoController {

    @Resource
    private UserInfoService userInfoService;


    /**
     * 用户注册
     */
    @PostMapping("/addUser")
    public Result addUserInfo(@RequestBody UserInfo userInfo){
        return userInfoService.addUserInfo(userInfo);
    }

    /**
     * 查询用户
     */
    @PostMapping("/queryUser")
    public Result queryUserInfo(@RequestBody UserInfo userInfo){
        return userInfoService.queryUserInfo(userInfo);
    }
    /**
     * 查询用户（分页擦汗寻）
     */
    @PostMapping("/queryUserPage")
    public Result queryUserInfoPage(@RequestBody PageInfo pageInfo){
        return userInfoService.queryUserInfoPage(pageInfo);
    }
}
